package com.ljkj.cordial.chat.presenter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.ljkj.cordial.chat.R;
import com.ljkj.cordial.chat.bean.ChatTableUnit;
import com.ljkj.cordial.chat.bean.MsgType;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 历史时间
 */
public class HistoryTimePresenter extends AChatPresenter {
    public HistoryTimePresenter(int direction) {
        super(direction);
//        LayoutInflater.from(view.getContext()).inflate(R.layout.item_chat_history_time_text, null);
    }

    @Override
    public RecyclerView.ViewHolder getViewHolder(View view) {
        return new ViewHolder(view);
    }

    @Override
    public void bindViewHolder(RecyclerView.ViewHolder holder, Object obj, int position) {
        ViewHolder holder1 = (ViewHolder) holder;
        ChatTableUnit item = (ChatTableUnit) obj;
        holder1.tvTime.setText(MsgType.getChatLastMsgTime(item.getHistoryTime()));
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.tv_time)
        TextView tvTime;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
            setIsRecyclable(false);
        }
    }
}
